package org.fujay.langchain4jserver.domain.application.vo;

import cn.hutool.core.util.IdUtil;
import org.springframework.util.Assert;

import java.io.Serial;
import java.io.Serializable;

/**
 * 应用ID值对象
 */
public record AppId(Long value) implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    public AppId {
        Assert.notNull(value, "App ID value cannot be null");
    }

    public static AppId create() {
        return new AppId(IdUtil.getSnowflakeNextId());
    }
}
